<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit" />
<title>云校通OA办公系统-登录界面</title>
<link href="__STATIC__/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="__STATIC__/js/jquery-1.12.4.min.js"></script>
<script src="__STATIC__/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<style>
	.input{
		background:url(__STATIC__/images/inputBg.jpg); 
		width:150px; 
		height:20px; 
		border:0;
		color: #000;
		padding-left: 4px;
	}
</style>
</head>
<body style="background:#075AA0;color:#FFF;font-size:14px;">
	<form name="loginForm" id="loginForm" method="post" target="kuang" action="">
		<div style="width:513px;height:305px; margin:130px auto 0px; border:5px #FFFFFF solid;">
			<table border="0" cellspacing="0" cellpadding="0">
			  <tr><td colspan="3">
			  	<!-- <img src="__STATIC__/images/loginBg_r1_c1.jpg" width="503" height="122" /> -->
			  	<div style="width: 503px;height: 122px;line-height: 122px;font-size: 40px;font-weight: bold;text-align: center;">云校通OA</div>
			  </td>
			  </tr>
			  <tr><td><img src="__STATIC__/images/loginBg_r2_c1.jpg" width="132" height="98" /></td>
			    <td width="250" style="background:url(__STATIC__/images/loginBg_r2_c2.jpg)">
			     登陆账号：<input id="username" name="username" type="text" class="input" value=""  /><br><br>
			     登陆密码：<input id="password" name="password" type="password" class="input" value="" /></td>
			    <td id="showbtn"><img src="__STATIC__/images/loginBg_r2_c3.jpg" width="121" height="97" onclick="loginSubmit()" style="cursor:pointer" /></td>
			  </tr>
			  <tr><td colspan="3">
				  	<div style="position: relative;">
					  	<img src="__STATIC__/images/loginBg_r3_c1.jpg" width="503" height="76" />
					  	<p style="position: absolute;top: 40px;left: 160px;color:#aea8a8;">版权所有：云校通 @2016</p>
					</div>
				</td>
			  </tr>
			</table>
		</div>
	</form>
	<script>
	$('#loginModal').modal({'backdrop':false});
	document.onkeydown = function(e){
        var ev = document.all ? window.event : e;
        if(ev.keyCode==13) {
            loginSubmit();
        }
    }
	function loginSubmit(){
		if($('#username').val()==''||$('#password').val()==''){
			return false;
		}
		$.ajax({
			url: "{:url('Login/check')}?r="+Math.random(),
			type: 'POST',
			data: $('#loginForm').serialize()
		})
		.done(function(data) {
			if(data=='登录成功'){
			    window.location.href = "/index";
			}else{
				$('#password').val('');
		    	alert(data);
			}

		})
		.fail(function() {
			alert('error,发生错误请及时联系管理员!');
		});
	}
	</script>
</body>
</html>
